package com.tedu.review.oop;

/**
 * super关键字
 */
 class Animal {
     //属性/成员变量
    String name ="动物";
    //方法/成员方法
    public void say(){
        System.out.println(name+"语言~");
    }
public Animal(){
    System.out.println("父类---动物---构造器");
}
   public Animal(String name) {
        this.name =name;

   }

}

class Dog extends Animal {
    public Dog() {
        System.out.println("狗");
    }


    public void say() {
        System.out.println("旺旺~~");
    }

    public void sayTest() {
        System.out.println("super.name+");
        super.say();
    }
}
 class Super关键字 {
         public static void main(String[] args) {
             Dog dog = new Dog();
             dog.sayTest();

         }
     }



